<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>搜索界面</title>
    <style>
        /* 简单的样式 */
        body, html {
            height: 100%;
            margin: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        #searchBox {
            margin-bottom: 10px;
            width: 300px;
        }

        #results {
            width: 300px;
            background-color: #f9f9f9;
            padding: 10px;
            border: 1px solid #ddd;
        }
    </style>
</head>
<body>

<div>
    <input type="text" id="searchBox" placeholder="请输入搜索内容" oninput="search()" style="align-items: center">
    <div id="results"></div>
</div>

<script>
    var data = ;

    function search() {
        const input = document.getElementById('searchBox').value;
        const results = data.filter(item => item.includes(input));
        displayResults(results);
    }

    function displayResults(results) {
        const resultsDiv = document.getElementById('results');
        resultsDiv.innerHTML = ''; // 清空上一次的搜索结果
        results.forEach(result => {
            const div = document.createElement('div');
            div.textContent = result;
            resultsDiv.appendChild(div);
        });
    }
</script>
</body>
</html>